package com.cqust.icc;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    EditText inputPhone;
    EditText inputPassword;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        inputPhone = findViewById(R.id.input_1);
        inputPassword = findViewById(R.id.input_2);

        setTitle("登录");

    }

    public void loginClick(View view) {

        String s = inputPhone.getText().toString();
        String s1 = inputPassword.getText().toString();

        if ("zhangcheng".equals(s) && "123".equals(s1))

            startActivity(new Intent(MainActivity.this, GridActivity.class
            ));
        else {
            Toast.makeText(MainActivity.this, "用户名或者密码错误，请重试", Toast.LENGTH_SHORT).show();
        }
    }
}